package demo518;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        Emp emp1=new Emp();
        emp1.setNumber("1001");
        emp1.setName("桑启");
        emp1.setAge(11);
        Emp emp2=new Emp();
        emp2.setNumber("1002");
        emp2.setName("小乔");
        emp2.setAge(12);
        Emp emp3=new Emp("1003","安琪拉",13);
        System.out.println(emp3.getNumber());
        System.out.println(emp3.getName());
        System.out.println(emp3.getAge());

        List<Emp> list =new ArrayList();
        list.add(emp1);
        list.add(emp2);
        list.add(emp3);

        System.out.println("集合的元素");
        for(int i=0;  i<list.size();  i++){
            System.out.println(list.get(i));
        }

    }
}
